#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int hours = 0, minutes = 0, seconds = 0;
	scanf("%d", &n);
	hours = n / 3600;
	n %= 3600;
	minutes = n / 60;
	n %= 60;
	seconds = n;
	printf("%d %d %d", hours, minutes, seconds);

	return 0;
}